home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Views
/
Panes
/
Pane.cp
< prev
next >
Wrap
Text File
|
2000-06-23
|
957b
|
52 lines
// Pane.cp
#ifndef Pane_h
#include "Pane.h"
#endif
#ifndef ViewCell_h
#include "ViewCell.h"
#endif
#ifndef Canvas_h
#include "Canvas.h"
#endif
Pane::Pane( const DrawsSpontaneously *theParent )
: parent( theParent ),
content( &ViewCell::Blank() ),
viewLink( this )
{
}
Pane::~Pane()
{
}
void Pane::Clear()
{
content = &ViewCell::Blank();
if ( viewLink.Owned() )
viewLink.Owner().Remove( viewLink );
}
void Pane::SetContent( View& view,
DrawsSpontaneously *drawsSpontaneously )
{
if ( viewLink.Owned() )
viewLink.Owner().Remove( viewLink );
content = &view;
if ( drawsSpontaneously != 0 )
drawsSpontaneously->panes.Add( viewLink, afterEnd );
}
void Pane::Deliver( CellVisitor& visitor,
const Canvas& parentCanvas,
Canvas& scratchCanvas ) const
{
scratchCanvas = parentCanvas;
Adjust( scratchCanvas );
if ( scratchCanvas.Visible() )
content->Deliver( visitor, scratchCanvas );
}